Image-Processing Device Removing Encircling Lines for Identifying Sub-Regions of Image

ABSTRACT

The present invention provides an image-processing device that includes a processor and a memory. The memory stores computer-readable instructions therein. The computer-readable instructions cause the image-processing device to perform identifying a first region and a second region in a target image. The first region represents an encircling line for identifying a specific sub-region in the target image. The first region includes a plurality of pixels. The second region includes an inside region that is surrounded by the first region, and an outside region that is outside the first region. The image-processing device further performs changing a color value of a first target pixel included in the plurality of the pixels using a first internal pixel and a first external pixel.

CROSS REFERENCE TO RELATED APPLICATION

This application claims priority from Japanese Patent Application No.2013-056397 filed Mar. 19, 2013. The entire content of the priorityapplication is incorporated herein by reference.

TECHNICAL FIELD

The present invention relates to an image-processing device and acomputer program that employ encircling lines for identifyingsub-regions of an image.

BACKGROUND

Among the various conventional image processes known in the art, thereare image processes for identifying sub-regions of an image and forprocessing the identified sub-regions. One such image process that hasbeen proposed involves accentuating regions of an image delineated byclosed curves by increasing the density in those regions. In thisprocess, the user draws closed curves on the original using a marker andscans the original with an image scanner. The image data acquired fromthe scanning operation is then processed.

SUMMARY

In the process described above, encircling lines (such as closed curves)surrounding sub-regions in the image can be used for identifyingspecific sub-regions. Various image processes, including but not limitedto an accentuating process, can be performed on the sub-regionsidentified by encircling lines. However, noticeable traces of theencircling lines drawn may be left unintentionally in the processedimage. For example, the outputted processed image may still include theencircling lines in a color different from the color of the regionsurrounding the encircling lines.

In view of the foregoing, it is an object of the present invention toprovide a technique for preventing encircling lines drawn in an imagefrom being noticeable after image processing.

In order to attain the above and other objects, the present inventionprovides an image-processing device that includes a processor and amemory. The memory stores computer-readable instructions therein. Thecomputer-readable instructions, when executed by the processor, causethe image-processing device to perform identifying a first region and asecond region in a target image represented by target image data. Thefirst region represents an encircling line for identifying a specificsub-region in the target image. The first region includes a first targetpixel and a second target pixel. The second region is different from thefirst region. The second region includes an inside region that issurrounded by the first region, and an outside region that is outsidethe first region. The inside region has a plurality of internal pixels.The outside region has a plurality of external pixels. Thecomputer-readable instructions further causes the image-processingdevice to perform to change a color value of each of the plurality ofpixels using a color value of one of the plurality of internal pixelsand a color value of one of the plurality of external pixels, whereinthe changing changes a color value of a first target pixel included inthe plurality of pixels using a color value of a first internal pixelincluded in the plurality of internal pixels and a color value of afirst external pixel included in the plurality of external pixels, andwherein the changing changes a color value of a second target pixelincluded in the plurality of pixels using a color value of a secondinternal pixel included in the plurality of internal pixels and a colorvalue of a second external pixel included in the plurality of externalpixels.

According to another aspect, the present invention provides anon-transitory computer readable storage medium storing a set of programinstructions executed by a computer. The program instructions includeidentifying a first region and a second region in a target imagerepresented by target image data. The first region represents anencircling line for identifying a specific sub-region in the targetimage. The first region includes a first target pixel and a secondtarget pixel. The second region is different from the first region. Thesecond region includes an inside region that is surrounded by the firstregion, and an outside region that is outside the first region. Theinside region has a plurality of internal pixels. The outside region hasa plurality of external pixels. The computer-readable instructionsfurther causes the image-processing device to perform to change a colorvalue of each of the plurality of pixels using a color value of one ofthe plurality of internal pixels and a color value of one of theplurality of external pixels, wherein the changing changes a color valueof a first target pixel included in the plurality of pixels using acolor value of a first internal pixel included in the plurality ofinternal pixels and a color value of a first external pixel included inthe plurality of external pixels, and wherein the changing changes acolor value of a second target pixel included in the plurality of pixelsusing a color value of a second internal pixel included in the pluralityof internal pixels and a color value of a second external pixel includedin the plurality of external pixels.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings:

FIG. 1 is a block diagram showing the structure of an image-processingsystem according to a first embodiment of the present invention;

FIG. 2 is a flowchart illustrating steps in an image process;

FIG. 3A is a schematic diagram showing a sample image represented byscan data;

FIG. 3B is a schematic diagram showing an example of a binary image;

FIG. 3C is a schematic diagram showing an example of a binary image thathas undergone contraction and expansion processes;

FIG. 3D is a schematic diagram showing an example of a partial binaryimage;

FIG. 3E is a schematic diagram showing an example of a processed image;

FIG. 4 is a flowchart illustrating steps in a color correction processperformed on an encircling line region;

FIG. 5A is a schematic diagram illustrating the color correction processperformed on the encircling line region according to the firstembodiment;

FIG. 5B shows an equation for calculating a color value of a firsttarget pixel according to the first embodiment;

FIG. 6A is a schematic diagram illustrating a color correction processperformed on the encircling line region according to a secondembodiment;

FIG. 6B shows an equation for calculating the color value of the firsttarget pixel according to the second embodiment;

FIG. 7A is a schematic diagram illustrating a color correction processperformed on the encircling line region according to a third embodiment;

FIG. 7B is a schematic diagram showing a relationship between a firstsearching range and a width of the encircling line according to thethird embodiment;

FIG. 7C shows an equation for calculating the color value of the firsttarget pixel according to the third embodiment;

FIG. 8A is a schematic diagram illustrating a color correction processperformed on the encircling line region according to a fourthembodiment;

FIG. 8B is an explanatory diagram for describing four pixel pairs, colorvalue differences, and selected pixel pairs according to the fourthembodiment;

FIG. 8C shows an equation for calculating the color value of the firsttarget pixel according to the fourth embodiment; and

FIG. 9 is a schematic diagram illustrating a color correction processperformed on the encircling line region according to a fifth embodiment.

DETAILED DESCRIPTION

An image-processing system and a computer program according toembodiments of the present invention will be described in detail withreference to the accompanying drawings.

A. First Embodiment

An image-processing system 900 according to a first embodiment of thepresent invention will be described with reference to FIGS. 1 to 5. FIG.1 is a block diagram showing the structure of an image-processing system900 according to the first embodiment of the present invention. Theimage-processing system 900 is configured of a network 500, amultifunction peripheral 100 connected to the network 500, and a server300 also connected to the network 500. The multifunction peripheral 100can execute a process for copying an original in response to a commandfrom the user. More specifically, the multifunction peripheral 100optically scans an original and prints an image based on the scan data.An original may represent a plurality of objects that may include text,photos, and illustrations. The user can draw a line around each objectin the original (hereinafter called an “encircling line”) using a penhaving a prescribed color (red, in the first embodiment). Themultifunction peripheral 100 and server 300 execute an image process toprint an image acquired by erasing any object surrounded by anencircling line from the scanned image.

The multifunction peripheral 100 includes a CPU 110 for performingoverall control of the multifunction peripheral 100; a volatile storagedevice 120, such as DRAM; a nonvolatile storage device 130, such as aflash memory; a display unit 140 such as a liquid crystal panel; anoperating unit 150 such as a touchscreen; a reading unit 160; a printingunit 170; and a communication interface 180 (a wireless communicationinterface conforming to the IEEE 802.11a/b/g/n standards, for example)for communicating with other devices, such as the server 300. Thenonvolatile storage device 130 stores a program 132. The communicationinterface 180 is connected to the network 500.

The reading unit 160 generates image data representing an original byoptically scanning the original. The reading unit 160 is provided withan optical sensor such as a contact image sensor (CIS; not shown) foroptically reading an original placed on the reading unit 160 to generateimage data representing the original. In the following description,image data generated by the reading unit 160 will be called “scan data.”

The printing unit 170 is an inkjet printer that functions to printimages. However, the present invention may employ another type ofprinter, such as a laser printer.

The CPU 110 executes the program 132 while utilizing the volatilestorage device 120 and the nonvolatile storage device 130 in order toimplement data processes described later. Taken together, the CPU 110,the volatile storage device 120, and the nonvolatile storage device 130correspond to a data-processing unit 190 used to execute the functionsto implement data processes. As shown in FIG. 1, the CPU 110 functionsas a read control unit 210, a scan data output unit 220, a processeddata acquisition unit 230, and a print control unit 240. The functionsof these process units will be described later.

The server 300 includes a CPU 310 for performing overall control of theserver 300; a volatile storage device 320, such as DRAM; a nonvolatilestorage device 330, such as flash memory; and a communication interface380 (a wireless communication interface conforming to the IEEE 802.3standard, for example) for communicating with other devices, such as themultifunction peripheral 100. The nonvolatile storage device 330 storesa program 332. The communication interface 380 is connected to thenetwork 500.

The CPU 310 executes the program 332 while utilizing the volatilestorage device 320 and nonvolatile storage device 330 to implement animage process described later. Taken together, the CPU 310, the volatilestorage device 320, and the nonvolatile storage device 330 correspond toan image-processing unit 390 that serves to implement the image process.As shown in FIG. 1, the CPU 310 functions as a target data acquisitionunit 410, a region identification unit 420, a color value modificationunit 430, an object process unit 440, and a processed data output unit450. The functions of these process units will be described later.

FIG. 2 is a flowchart illustrating steps in the image process, andindicates both the process performed by the multifunction peripheral 100and the process performed by the server 300. The CPU 110 of themultifunction peripheral 100 begins this image process when the userissues a command to the multifunction peripheral 100 to copy anoriginal, for example. The user can input various data including copycommands by operating the operating unit 150 of the multifunctionperipheral 100.

In S100 at the beginning of the image process, the read control unit 210(see FIG. 1) of the multifunction peripheral 100 controls the readingunit 160 to acquire scan data representing the original. Scan data isbitmap data representing colors in red (R), green (G), and blue (B)color component values (256-level gradation values in the firstembodiment), for example. Hereinafter, red, green, and blue colorcomponent values will be respectively called the R component value, Gcomponent value, and B component value. Further, values representing acolor will be collectively called a “color value” (for example, the setof R, G, and B component values).

FIG. 3A is a schematic diagram showing a sample image represented byscan data (hereinafter called a “scanned image”). A scanned image 80 inFIG. 3A includes an encircling line object 85 and four illustrationobjects: a first object 81, a second object 82, a third object 83, and afourth object 84. The encircling line object 85 is an object that theuser has handwritten on the original using a pen in a predeterminedcolor (red in the preferred embodiment).

FIGS. 3A, 3B, 3C and 3D also indicate a first direction Dx and a seconddirection Dy. The scan data representing the scanned image 80 indicatesthe color of each pixel arranged in gridlines along the directions Dxand Dy. In the following description, the first direction Dx will alsobe called the +Dx direction, while the direction opposite to the firstdirection Dx will be called the −Dx direction. Similarly, the seconddirection Dy will also be called the +Dy direction, while the oppositedirection will be called the −Dy direction. In addition, the siderelative to the +Dx direction will be simply called the +Dx side, andthe same wording will be used for other directions.

In S110 of FIG. 2, the scan data output unit 220 (see FIG. 1) outputsthe scan data to the server 300 via the network 500. In S200 the targetdata acquisition unit 410 (see FIG. 1) of the server 300 acquires thescan data from the multifunction peripheral 100 as image data to beprocessed (also called “target image data”). The subsequent stepsS205-S220 constitute a process for identifying an encircling line in thescanned image 80.

In S205 the region identification unit 420 (see FIG. 1) generates binaryimage data through a thresholding process on the scan data.Specifically, the region identification unit 420 classifies each of thepixels in the scan data as either a pixel having a color value thatspecifies the color of the encircling line (red in the first embodiment)or a pixel possessing a color value specifying another color. Pixelshaving a color value specifying the color of the encircling line will becalled candidate pixels, while pixels having other color values will becalled non-candidate pixels. The thresholding process is performed basedon a prescribed range of colors appropriate for pixels representing anencircling line (hereinafter called the “encircling line color range”).Since the color of the encircling line is assumed to be red in the firstembodiment, the encircling line color range may be set to a range ofcolors in which the R component value is at least a red reference valueRth, the G component value is no greater than a green reference valueGth, and the B component value is no greater than a blue reference valueBth. Pixels having color values that fall within the encircling linecolor range are classified as candidate pixels, while pixels havingcolor values outside the encircling line color range are classified asnon-candidate pixels. Note that the encircling line color may be set toa color other than red, and the encircling line color range may be setto a partial color range that includes the color anticipated to be thecolor of the encircling line.

FIG. 3B is a schematic diagram showing an example of a binary image 80 arepresented by the binary image data. The binary image 80 a includesthree separate candidate regions: a first candidate region 81 a, asecond candidate region 84 a, and a third candidate region 85 a. Thefirst candidate region 81 a represents part of the first object 81; thesecond candidate region 84 a represents part of the fourth object 84;the third candidate region 85 a represents the encircling line object85. Each of the candidate regions 81 a, 84 a, and 85 a is configured ofa plurality of contiguous candidate pixels. Here, two pixels areconsidered to be contiguous (i.e., adjacent to each other) when onepixel is positioned within a 3×3 pixel block centered on the otherpixel. As an alternative, two pixels may be considered to be contiguouswhen one pixel is adjacent to the other pixel in one of the fourdirections +Dx, −Dx, +Dy, and −Dy.

In S210 of FIG. 2, the region identification unit 420 executes acontraction process on the binary image data for contracting thecandidate regions, resulting in the generation of contracted binaryimage data. Next, the region identification unit 420 executes anexpansion process on the contracted binary image data for expanding thecontracted candidate regions, producing expanded binary image data.

The contraction process is implemented by performing a process for eachnon-candidate pixel (target pixel) in the binary image data to convertall candidate pixels within a prescribed contraction range of the targetpixel to non-candidate pixels, for example. This contraction range maybe, for example, a 3×3 (three rows×three columns) range centered on anon-candidate pixel serving as the target pixel. The contraction processserves to change candidate pixels near this non-candidate pixel, i.e.,candidate pixels forming the edge of a candidate region, intonon-candidate pixels, thereby contracting the candidate region. Thisprocess also eliminates small candidate regions produced by noise, i.e.,candidate regions configured of only a few candidate pixels (not shownin the drawings).

The expansion process is implemented by performing a process for eachcandidate pixel (target pixel) in the binary image data to convert allnon-candidate pixels within a prescribed expansion range of the targetpixel to candidate pixels, for example. The expansion range may be a 5×5(five rows×five columns) range centered on a candidate pixel serving asthe target pixel, for example. Thus, the expansion process changesnon-candidate pixels near a candidate pixel, i.e., non-candidate pixelsnear the edge of a candidate region, to candidate pixels, therebyexpanding the candidate region. In addition, breaks in the thirdcandidate region 85 a representing the encircling line object 85(hereinafter called “disconnected parts”) may be produced in thecontraction process due to noise or thin or faint pen lines (not shown).The expansion process can also connect these disconnected parts.

FIG. 3C is a schematic diagram showing an example of a binary image 80 brepresented by binary image data that has undergone the contraction andexpansion processes. The binary image 80 b includes three candidateregions: a first candidate region 81 b, a second candidate region 84 b,and a third candidate region 85 b. The candidate regions 81 b, 84 b, and85 b respectively correspond to the three candidate regions 81 a, 84 a,and 85 a represented by the binary image 80 a of FIG. 3B.

As described above, the contraction and expansion processes serve toeliminate noise and to connect disconnected parts. Accordingly,performing these processes can improve the precision in identifying theencircling lines in an object identification process described later.

The contraction range and the expansion range described above are merelyone example of the degree of contraction achieved by the contractionprocess and the degree of expansion achieved by the expansion process,respectively. When the contraction process is performed prior to theexpansion process, the degree of the expansion process (i.e., the sizeof the expansion range) is preferably larger than the degree of thecontraction process (i.e., the size of the contraction range). Settingthe ranges to have this relationship can more appropriately connectdisconnected parts. However, the expansion process may be executed priorto the contraction process, in which the degree of the expansion processis preferably smaller than the degree of the contraction process. Thisrelationship can more appropriately eliminate candidate regions producedby noise.

In S215 of FIG. 2, the region identification unit 420 performs alabeling process on the binary image data resulting from the contractionand expansion processes to assign discrete identifiers to the separatecandidate regions. Specifically, the region identification unit 420assigns one identifier to each region configured of one or morecontiguous candidate pixels (i.e., a candidate region). The regionidentification unit 420 assigns a different identifier to each of theplurality of separate candidate regions. Thus, the labeling processserves to identify each of the candidate regions. In the example of FIG.3C, the region identification unit 420 assigns a discrete identifier toeach of the first candidate region 81 b, the second candidate region 84b, and the third candidate region 85 b. The region identification unit420 generates first label data representing the results of this labelingprocess (for example, data correlating pixels with identifiers).

In S220 of FIG. 2, the region identification unit 420 executes theobject identification process on the candidate regions identified inS215. The object identification process serves to identify a regionrepresenting an encircling line from among the identified candidateregions. For example, when a candidate region has a loop-like shape, theregion identification unit 420 determines that this candidate regionrepresents an encircling line. In the example of FIG. 3C, the regionidentification unit 420 identifies the loop-shaped third candidateregion 85 b as a region representing an encircling line. Hereinafter, acandidate region representing an encircling line will be called an“encircling line region.”

Any of various methods may be used to determine whether a candidateregion has a loop shape. Here, one possible method will be describedusing the example of the binary image 80 b in FIG. 3C. In this example,the candidate region being subjected to the determination will be calledthe “target region”; pixels in the target region will be called“target-region pixels”; and pixels outside the target region will becalled “non-target-region pixels.” Hence, when the third candidateregion 85 b is the target region, all pixels included in the thirdcandidate region 85 b are target-region pixels, while all pixels notincluded in the third candidate region 85 b are non-target-regionpixels. Specifically, the non-target-region pixels include pixelsrepresenting the background inside the third candidate region 85 b,pixels representing the background outside the third candidate region 85b, and pixels included in the candidate regions 81 b and 84 b.

First, the region identification unit 420 identifies a region thatincludes the edges of the binary image 80 b and has a plurality ofcontiguous non-target-region pixels. The identified region surrounds theentire outer periphery of the target region and will be called a “firstperipheral region.” When the third candidate region 85 b is the targetregion, the first peripheral region includes every region on the outsideof the third candidate region 85 b, i.e., the region representing thebackground on the outer peripheral side of the third candidate region 85b, the entire first candidate region 81 b, and the second candidateregion 84 b positioned on the outside of the third candidate region 85b.

The region remaining after excluding the first peripheral region fromthe binary image 80 b is the region encircled by the outermost contourof the target region (hereinafter called the “first determinationregion”). When the third candidate region 85 b is the target region, thefirst determination region is the entire area enclosed by the outermostcontour of the third candidate region 85 b, i.e., the third candidateregion 85 b and the region representing background on the inside of thethird candidate region 85 b.

Next, the region identification unit 420 determines that the targetregion has a loop-like shape when the first determination region isfound to have an area that includes a plurality of contiguousnon-target-region pixels. When the third candidate region 85 b is thetarget region, the region identification unit 420 detects an area havinga plurality of contiguous non-target-region pixels (the regionrepresenting background) within the first determination region(specifically, the area inside of the third candidate region 85 b).Accordingly, the region identification unit 420 determines that thethird candidate region 85 b has a loop shape. When the regionidentification unit 420 does not detect an area with a plurality ofcontiguous non-target-region pixels in the first determination region,the region identification unit 420 determines that the target regiondoes not have a loop shape. For example, if the first candidate region81 b or the second candidate region 84 b is the target region, theregion identification unit 420 will determine that the target regiondoes not have a loop shape.

Subsequent steps S225-S245 in FIG. 2 constitute a process foridentifying a region representing an object encircled by the encirclingline. In S225 the region identification unit 420 selects one encirclingregion from among those encircling regions identified in S220. Thefollowing description will assume that the third candidate region 85 bis in FIG. 3C has been selected as the target encircling region.

In S230, the region identification unit 420 acquires partial image datathat represent a region encompassing the third candidate region 85 bfrom the scan data acquired in S200. FIGS. 3A and 3C indicate a regionAr encompassing the third candidate region 85 b (hereinafter called acropped area Ar. In the first embodiment, the cropped area Ar is arectangular region represented by the minimum bounding rectanglebounding the third candidate region 85 b. The region identification unit420 acquires the portion of scan data representing the cropped area Arshown in FIG. 3A as the partial image data.

In S235 of FIG. 2, the region identification unit 420 generates partialbinary image data by performing a thresholding process on the partialimage data. More specifically, the region identification unit 420classifies each of the pixels in the partial image data as either apixel having a color value denoting the background color (hereinaftercalled a “background pixel”) or a pixel having a color valuecorresponding to a color other than the background color (hereinaftercalled an “object pixel”).

This thresholding process is performed based on a background color rangedenoting a range of colors for pixels representing the background. Inthe first embodiment, the region identification unit 420 calculates acolor value representing the background color (hereinafter called the“background color value”) to be the average color value of a pluralityof pixels in the scanned image 80 of FIG. 3A that neighbor the thirdcandidate region 85 b in FIG. 3C. The background color value calculatedin S235 includes average values of the R component value, G componentvalue, and B component value called an R average value Rave, a G averagevalue Gave, and a B average value Bave, respectively.

Next, the region identification unit 420 sets a color range ofprescribed width centered on the background color value as thebackground color range. For example, the background color range may be arange of colors: (Rave−W)<R component value<(Rave+W), (Gave−W)<Gcomponent value<(Gave+W), and (Bave−W)<background color value<(Bave+W);where, W is a prescribed value corresponding to width.

Note that the background color range is not limited to the rangedescribed above, but may be any of various ranges that include colors inthe background portions of the scanned image 80. For example, thebackground color range may be set to a range of colors whose distancefrom the background color value described above (the Euclidian distancein the RGB color space, for example) is within a prescribed thresholdvalue. Further, the background color value may be calculated accordingto any of various methods and is not limited to the method describedabove. For example, the background color value may be set to the averagecolor value of pixels disposed in the edge portion of the scanned image80. Generally, the region identification unit 420 can analyze thescanned image 80 and implement a thresholding process appropriate forthe scanned image 80 by setting a background color range based on theresults of this analysis. However, a prescribed range may be employed asthe background color range. For example, the background color range maybe set to a range of colors whose brightness value computed from the R,G, and B component values is at least a prescribed thresholding value.

FIG. 3D is a schematic diagram showing an example of a partial binaryimage 80 c represented by the partial binary image data. The partialbinary image 80 c includes three separate object regions: a first objectregion 81 c, a second object region 82 c, and a third object region 85c. Each of the object regions 81 c, 82 c, and 85 c is configured of aplurality of contiguous object pixels. The first object region 81 crepresents the first object 81; the second object region 82 c representsthe second object 82; and the third object region 85 c represents theencircling line object 85.

In S240 of FIG. 2, the region identification unit 420 performs alabeling process on the partial binary image data. The steps in thelabeling process are identical to those in the labeling process of S215.In the example of FIG. 3D, the region identification unit 420 assigns adiscrete identifier to each of the first object region 81 c, secondobject region 82 c, and third object region 85 c. The regionidentification unit 420 generates second label data representing theresults of this labeling process (for example, data correlating pixelswith the identifiers).

The region identification unit 420 also identifies object regionsoverlapping the encircling line regions identified in S220 as encirclingline regions. Since the third object region 85 c overlaps the thirdcandidate region 85 b of FIG. 3C in the example of FIG. 3D, the regionidentification unit 420 identifies the third object region 85 c as anencircling line region 85 c.

In S245 of FIG. 2, the region identification unit 420 determines whetheran object region is enclosed by the encircling line region 85 c, foreach of the object regions other than the encircling line region 85 c.For example, the region identification unit 420 determines that anobject region is enclosed by the encircling line region 85 c when theobject region overlaps the region on the inner side of the encirclingline region 85 c (hereinafter called an “inside region 85 ci”). In theexample of FIG. 3D, the second object region 82 c overlaps the insideregion 85 ci. Thus, the region identification unit 420 determines thatthe second object region 82 c is encircled by the encircling line region85 c. The first object region 81 c does not overlap the inside region 85ci, but overlaps the region on the outer side of the encircling lineregion 85 c (hereinafter called an “outside region 85 co”). Thus, theregion identification unit 420 determines that the first object region81 c is not enclosed by the encircling line region 85 c. The regionidentification unit 420 also generates inclusion relation datarepresenting the determination results, such as data representingcorrelations between the identifier of an object region and a flagindicating whether the object region is enclosed by the encircling lineregion 85 c.

Note that any of various methods may be employed to determine whether anobject region overlaps the region inside the encircling line region 85 c(the inside region 85 ci in this example). Here, one possible methodwill be described using the example of the partial binary image 80 c inFIG. 3D. In this description, pixels included in the encircling lineregions will be called “encircling-line pixels,” and pixels other thanthe encircling-line pixels will be called “non-encircling-line pixels.”In the example of FIG. 3D, pixels included in the encircling line region85 c are encircling-line pixels, while pixels not included in theencircling line region 85 c are non-encircling-line pixels. That is, thenon-encircling-line pixels include pixels representing the backgroundinside the encircling line region 85 c, pixels representing thebackground outside the encircling line region 85 c, and pixels includedin the first object region 81 c and second object region 82 c.

First, the region identification unit 420 identifies a region thatincludes the edges of the partial binary image 80 c and is configured ofa plurality of contiguous non-encircling-line pixels. The identifiedregion surrounds the outer peripheral side of the encircling line region85 c (the outside region 85 co in this example) and is hereinaftercalled the “second peripheral region.” Specifically, the secondperipheral region is the entire outer peripheral side of the encirclingline region 85 c, i.e., the entire region representing the background onthe outer peripheral side of the encircling line region 85 c, and thefirst object region 81 c disposed on the outer peripheral side of theencircling line region 85 c.

Next, the region of the partial binary image 80 c that remains afterexcluding the second peripheral region is enclosed by the outermostcontour of the encircling line region 85 c (hereinafter called the“second determination region”). Specifically, the second determinationregion is the entire encircling line region 85 c and inside region 85ci. The inside region 85 ci includes the region representing thebackground on the inside of the encircling line region 85 c, and thesecond object region 82 c disposed inside the encircling line region 85c.

When the region identification unit 420 detects pixels for an objectregion in the second determination region, the region identificationunit 420 determines that an object overlaps the inside region 85 ci,i.e., an object is enclosed within the encircling line. In this example,the region identification unit 420 detects pixels for the second objectregion 82 c in the second determination region. Hence, the regionidentification unit 420 determines that the second object region 82 c(i.e., the second object 82) is enclosed within the encircling lineregion 85 c (i.e., the encircling line object 85). If the regionidentification unit 420 does not detect a pixel from an object region inthe second determination region, then the region identification unit 420determines that the object does not overlap the inside region 85 ci,i.e., that the object region is not enclosed by the encircling lineregion 85 c. In this example, the region identification unit 420 doesnot detect a pixel from the first object region 81 c in the seconddetermination region and, hence, determines that the first object region81 c is not enclosed within the encircling line region 85 c.

In this way, the region identification unit 420 identifies objectregions representing objects enclosed by the encircling line object 85.

Step S250 in FIG. 2 is a process for correcting the color of theencircling line region in order to erase the encircling line from thescanned image 80. The following step S255 is a process for erasingobjects enclosed by the encircling line from the scanned image 80. FIG.3E is a schematic diagram showing an example of a processed image 90.The processed image 90 is an image represented by processed datagenerated by executing the process of S255 on the scan data. As shown inFIG. 3E, the processed image 90 is obtained by erasing the encirclingline object 85 and the second object 82 enclosed by the encircling lineobject 85 from the scanned image 80.

In S250 of FIG. 2, the color value modification unit 430 (see FIG. 1)changes a color value for each pixel in the scanned image 80 that isincluded in the encircling line region 85 c represented by the partialbinary image 80 c to a color value corresponding to the color values ofpixels in the peripheral region of the encircling line region 85 c.Through this process, the region in the scanned image 80 thatrepresented the encircling line object 85 now represents the backgroundin the peripheral region thereof. The process in S250 will be describedlater in greater detail.

In S255 the object process unit 440 changes the color values of pixelsin the scanned image 80 that are included in the object regionrepresented by the partial binary image 80 c (and specifically, thesecond object region 82 c enclosed in the encircling line region 85 c)to the background color value. The background color value is the valuecalculated in S235. This process converts the region in the scannedimage 80 representing the second object 82 to background.

In S260 of FIG. 2, the region identification unit 420 determines whetherthe above process has been completed for all encircling line regions. Ifthere remain any unprocessed encircling line regions (S260: NO), theregion identification unit 420 returns to S225 and performs the aboveprocess on an unprocessed encircling line region.

Each of the processes in S250 and S255 is performed successively on scandata representing the scanned image 80. The processed image dataobtained by completing the processes on all encircling line regions isused as the final processed data.

When the process has been completed for all encircling line regions(S260: YES), in S265 the processed data output unit 450 outputs theprocessed data to the multifunction peripheral 100 via the network 500.In S120 the processed data acquisition unit 230 of the multifunctionperipheral 100 then acquires the processed data from the server 300. InS130 the print control unit 240 generates print data based on theprocessed data and supplies this print data to the printing unit 170.The printing unit 170 prints an image based on the print data receivedfrom the print control unit 240. In this example, the printing unit 170prints the image shown in FIG. 3E.

FIG. 4 is a flowchart illustrating steps in a color correction processperformed on the encircling line regions. This process corresponds tostep S250 in FIG. 2. In S310 at the beginning of the color correctionprocess, the color value modification unit 430 selects one unprocessedpixel from among the plurality of pixels in the target encircling lineregion (such as the encircling line region 85 c in FIG. 3D) as a targetpixel.

FIG. 5A is an explanatory diagram illustrating the color correctionprocess performed on the encircling line region. The drawing shows partof the encircling line region 85 c and its peripheral region. Theencircling line region 85 c has been shaded. In FIG. 5A, Pt denotes thetarget pixel and is hereinafter called the “first target pixel Pt.”

In S320 of FIG. 4, the color value modification unit 430 changes thecolor value of the target pixel in the scan data using color values ofnon-encircling-line pixels around the encircling line region 85 c. Inthe first embodiment, the color value modification unit 430 sets a newcolor value for the target pixel using the color values of fournon-encircling-line pixels determined based on the position of thetarget pixel. Hereinafter, pixels whose color values are used tocalculate the color value of the target pixel will be called “colorvalue pixels.” FIG. 5A shows four color value pixels P1-P4 determinedbased on the first target pixel Pt. Specifically, these color valuepixels are determined as follows.

The first color value pixel P1 is the closest non-encircling-line pixelto the first target pixel Pt among the plurality of non-encircling-linepixels on a line extending in the −Dy direction from the first targetpixel Pt. The second color value pixel P2 is the closestnon-encircling-line pixel to the first target pixel Pt among theplurality of non-encircling-line pixels on a line extending in the +Dydirection from the first target pixel Pt. The third color value pixel P3is the closest non-encircling-line pixel to the first target pixel Ptamong the plurality of non-encircling-line pixels on a line extending inthe −Dx direction from the first target pixel Pt. The fourth color valuepixel P4 is the closest non-encircling-line pixel to the first targetpixel Pt among the plurality of non-encircling-line pixels on a lineextending in the +Dx direction from the first target pixel Pt. All ofthe color value pixels P1-P4 selected in the above manner represent thebackground.

In this way, the color value modification unit 430 selects pixels to beused in calculating the new color value from lines extending from thefirst target pixel Pt in four orthogonal directions. Therefore, at leastone pixel (the two pixels P2 and P4 in this case) is selected from theinside region 85 ci, and at least one pixel (the two pixels P1 and P3 inthis case) is selected from the outside region 85 co. Hereinafter, apixel selected from the inside region 85 ci will be called an internalpixel, and a pixel selected from the outside region 85 co will be calledan external pixel.

FIG. 5B shows an equation for calculating a color value Pti of the firsttarget pixel Pt from color values P1 i-P4 i of the color value pixelsP1-P4, respectively. Here, the symbol “i” identifies one of the colorsred, green, and blue, and distances D1-D4 denote the distances betweenthe first target pixel Pt and the color value pixels P1-P4,respectively. The distance between two pixels may be set to theEuclidean distance between the centers of the pixels.

As shown in FIG. 5B, the color value Pti of the first target pixel Pt isa weighted average value of the color values P1 i-P4 i for the colorvalue pixels P1-P4. The weights assigned color values P1 i-P4 i arelarger for smaller distances D1-D4. Therefore, the color valuemodification unit 430 can change the color value of the first targetpixel Pt to a value suited to positional relationships between the firsttarget pixel Pt and the color value pixels P1-P4. Thus, the color valuemodification unit 430 can change the color value of the first targetpixel Pt to a value suited to color changes in peripheral regions of thefirst target pixel Pt (the background region, for example).

In S330 of FIG. 4, the color value modification unit 430 determineswhether all pixels in the target encircling line region have beenprocessed. When there remain unprocessed pixels (S330: NO), the colorvalue modification unit 430 returns to S310 and repeats the aboveprocess on an unprocessed pixel. The same process performed on the firsttarget pixel Pt is performed on pixels other than the first target pixelPt. FIG. 5A shows a second target pixel Ptn. In this case, the colorvalue modification unit 430 selects four color value pixels P1 n-P4 nbased on the second target pixel Ptn. Since the second target pixel Ptnis in a different position than the first target pixel Pt, the selectedcolor value pixels P1 n-P4 n can be different from the color valuepixels P1-P4 selected for the first target pixel Pt.

When all pixels in the target encircling line region have been processed(S330: YES), the color value modification unit 430 ends the process ofFIG. 4.

As described above, the color value modification unit 430 changes thecolor value of the first target pixel Pt in the encircling line region85 c using color values of internal pixels P2 and P4 in the insideregion 85 ci, and color values of external pixels P1 and P3 in theoutside region 85 co. The color value modification unit 430 then changesthe color value of the second target pixel Ptn in the encircling lineregion 85 c using the internal pixels P2 n and P4 n in the inside region85 ci and the external pixels P1 n and P3 n in the outside region 85 co.Since the color value modification unit 430 can change the color valueof a target pixel in the encircling line region 85 c constituting theencircling line object 85 to a color value suited to both the colorvalues of internal pixels and the color values of external pixels, thecolor value modification unit 430 can reduce the likelihood of the colorof the encircling line object 85 remaining in a color different from theperipheral color of the encircling line object 85 (the background color,for example) when the image is printed.

In particular, the equation in FIG. 5B can change the color value of thefirst target pixel Pt to a value between an internal pixel (one of thesecond color value pixel P2 and fourth color value pixel P4) and anexternal pixel (one of the first color value pixel P1 and third colorvalue pixel P3). Similarly, the equation can change the color value ofthe second target pixel Ptn to a value between an internal pixel (one ofthe second color value pixel P2 n and fourth color value pixel P4 n) andan external pixel (one of the first color value pixel P1 n and thirdcolor value pixel P3 n). Thus, this method can suppress unnaturalchanges in color within the encircling line region 85 c when the colorsin the inside region 85 ci and the outside region 85 co differ.

As described with reference to FIG. 5B, the weights assigned to thecolor values P1 i-P4 i are larger when the distances D1-D4 are smaller.Therefore, the color value modification unit 430 can change the colorvalue of the first target pixel Pt to a value that is suitable for thepositional relationships between the first target pixel Pt and the colorvalue pixels P1-P4. In the first embodiment, the pixels P1-P4 serving aspositional references are the same pixels used for acquiring the colorvalues P1 i-P4 i.

Further, as described with reference to FIG. 5A, the third color valuepixel P3 and the fourth color value pixel P4 used for calculating thecolor value of the first target pixel Pt are disposed on opposing endsof a line segment that intersects the line segment connecting the firstcolor value pixel P1 and second color value pixel P2. Therefore, thecolor value modification unit 430 can change the color value of thefirst target pixel Pt to a value suited to color changes in a pluralityof directions. The same is true for all other target pixels andsuppresses any noticeable traces of the encircling line object 85 in theprocessed image.

Note that the color values of pixels within the encircling line region85 c are carefully interpolated, as described in FIGS. 4 and 5, becausethe encircling line object 85 is an object that is not present in theimage on the original. Consequently, the user observing the processedimage would quickly sense something out of place if the processed imagecontained traces of an object not present in the original. Therefore,the color value modification unit 430 in the first embodiment carefullyinterpolates the color values of pixels in the encircling line region 85c to eliminate any noticeable traces of encircling lines in theprocessed image.

When generating or acquiring data such as scan data, processed data, andprint data, the process units 210, 220, 230, and 240 of themultifunction peripheral 100 (and specifically the CPU 110) store thisdata in a storage device such as the volatile storage device 120. Theprocess units 210, 220, 230, and 240 subsequently acquire data neededfor processes by referencing the data stored in the storage device.

Similarly, when generating or acquiring data such as scan data, binaryimage data, label data, inclusion relation data, and processed data, theprocess units 410, 420, 430, 440, and 450 of the server 300 (andspecifically the CPU 310) store this data in a storage device such asthe volatile storage device 320. The process units 410, 420, 430, 440,and 450 subsequently acquire data needed for processes by referencingthe data stored in the storage device.

B. Second Embodiment

A second embodiment of the present invention will be described withreference to FIGS. 6A and 6B. FIG. 6A is a schematic diagramillustrating a second embodiment for changing color values of targetpixels in encircling line regions (S320 of FIG. 4). The secondembodiment differs from the first embodiment shown in FIGS. 5A and 5B inthat color value pixels are selected at points falling on linesextending in eight discrete directions from the target pixel. Thehardware structure of the image-processing system used in the imageprocess according to the second embodiment is identical to theimage-processing system 900 shown in FIG. 1. Further, steps in the imageprocess according to the second embodiment are identical to the stepsshown in FIGS. 2 and 4.

The partial image shown in FIG. 6A is identical to the image in FIG. 5A.In addition to the four directions +Dx, −Dx, +Dy, and −Dy, FIG. 6Aindicates four additional directions +Ds, −Ds, +Dt, and −Dt. The +Dsdirection falls between the +Dx direction and +Dy direction and forms a45-degree angle with each of these directions. The −Ds direction is thedirection opposite the +Ds direction. The +Dt direction falls betweenthe +Dx direction and −Dy direction and forms a 45-degree angle witheach of these directions. The −Dt direction is the direction oppositethe +Dt direction.

As shown in FIG. 6A, the color value modification unit 430 selects eightcolor value pixels P1-P8 determined based on the position of the firsttarget pixel Pt. The four color value pixels P1-P4 are identical to thesame pixels in FIG. 5A. The remaining four color value pixels P5-P8 aredetermined as follows.

The fifth color value pixel P5 is the closest non-encircling-line pixelto the first target pixel Pt among the plurality of non-encircling-linepixels on a line extending in the −Ds direction from the first targetpixel Pt.

The sixth color value pixel P6 is the closest non-encircling-line pixelto the first target pixel Pt among the plurality of non-encircling-linepixels on a line extending in the +Ds direction from the first targetpixel Pt.

The seventh color value pixel P7 is the closest non-encircling-linepixel to the first target pixel Pt among the plurality ofnon-encircling-line pixels on a line extending in the +Dt direction fromthe first target pixel Pt.

The eighth color value pixel P8 is the closest non-encircling-line pixelto the first target pixel Pt among the plurality of non-encircling-linepixels on a line extending in the −Dt direction from the first targetpixel Pt.

Thus, the color value modification unit 430 selects pixels forcalculating the color value of the first target pixel Pt from pixels oneight lines extending radially from the first target pixel Pt.Therefore, the color value modification unit 430 selects at least onepixel (the three pixels P2, P4, and P6 in this example) from the insideregion 85 ci, and at least one pixel (the five pixels P1, P3, P5, P7,and P8 in this example) from the outside region 85 co.

FIG. 6B shows an equation for calculating the color value Pti of thefirst target pixel Pt based on color values P1 i-P8 i of the eight colorvalue pixels P1-P8. Here, the symbol “i” identifies one of the colorsred, green, and blue, and distances D1-D8 denote the distances from thefirst target pixel Pt to the color value pixels P1-P8, respectively. Inthe example of FIG. 6B, the color value modification unit 430 sets thecolor value Pti of the first target pixel Pt to the weighted averagevalue of the color values P1 i-P8 i for the color value pixels P1-P8.Weights assigned to the color values P1 i-P8 i are larger for smallerdistances D1-D8. Thus, the color value modification unit 430 changes thecolor value of the first target pixel Pt to a value suited to changes incolor within the peripheral region of the first target pixel Pt.

Thus, as in the first embodiment described above, the color value of thefirst target pixel Pt in the second embodiment is set using color valuesof a plurality of non-encircling-line pixels surrounding the firsttarget pixel Pt. Therefore, the second embodiment has the sameadvantages as the first embodiment. The second embodiment also uses moredirections from the first target pixel Pt than the first embodiment forselecting color value pixels to be used in calculating the color valueof the first target pixel Pt. Hence, the color value modification unit430 in the second embodiment can change the color value of a pixel in anencircling line region to a color value suitable for color changes inthe peripheral region surrounding the pixel in various directions.

C. Third Embodiment

A third embodiment of the present invention will be described withreference to FIGS. 7A, 7B and 7C. FIGS. 7A and 7B are schematic diagramsillustrating a third embodiment for changing color values of targetpixels in encircling line regions (S320 of FIG. 4). The third embodimentdiffers from the first embodiment shown in FIGS. 5A and 5B in that thefour color value pixels P1-P4 in FIGS. 5A and 5B are used as referencepixels P1 s-P4 s for referencing positions, while the color value pixelsP1-P4 used for calculating the color value of the target pixel areselected based on the reference pixels P1 s-P4 s. Here, color valuepixels separate from the reference pixels used as positional referencesare selected for calculating the color value of the target pixel inorder to minimize the effects of noise that may be included in the colorvalues of reference pixels adjacent to the encircling line region 85 c.A scanned image represented by scan data generated with the reading unit160 may contain noise in the color values of pixels neighboring edges ofobjects, such as encircling lines. Consequently, the color values ofreference pixels may include such noise. In order to minimize theeffects of this noise, the color value pixels used for calculating thecolor value of a target pixel in the third embodiment are selected fromregions on the periphery of the reference pixels that have little changein color value. The hardware structure of the image-processing systemused in the image process according to the third embodiment is identicalto the image-processing system 900 shown in FIG. 1. Further, steps inthe image process according to the third embodiment are identical to thesteps shown in FIGS. 2 and 4.

The partial image shown in FIG. 7A is identical to the image in FIG. 5A.The method of selecting color value pixels based on reference pixelswill be described below using a first reference pixel P1 s as anexample. The color value modification unit 430 selects the firstreference pixel P1 s according to the same procedure for selecting thefirst color value pixel P1 in FIG. 5A. Next, the color valuemodification unit 430 selects the first color value pixel P1 from thenon-encircling-line pixels in a first searching range P1 sa centered onthe first reference pixel P1 s. The first searching range P1 sa is aprescribed rectangular region centered on the first reference pixel P1 sthat has two sides parallel to the first direction Dx and two sidesparallel to the second direction Dy. The lengths of sides in the firstsearching range P1 sa are set to “2*(5*resolution/300)+1”, for example,where the symbol “*” is the multiplication operator and the resultingvalue is in units of pixels. “Resolution” in this equation is theresolution of the scan data and is in units of dpi. When the resolutionis 300 dpi, the length of one side of the first searching range P1 sa is11 pixels. When the resolution is 600 dpi, the length of one side of thefirst searching range P1 sa is 21 pixels. Thus, the size of the firstsearching range P1 sa grows substantially in proportion to resolution.Therefore, when the first searching range P1 sa is superimposed on theoriginal image, the range of the image covered by the first searchingrange P1 sa is approximately the same regardless the resolution of thescan data.

FIG. 7B is a schematic diagram showing the relationship between thefirst searching range P1 sa and a width WL of the encircling line. Asshown in the drawing, the size of the first searching range P1 sa ispreset such that a maximum distance Dsa from the first reference pixelP1 s to the edge of the first searching range P1 sa is smaller than thewidth WL of the encircling line. The width WL of the encircling line isthe width of a line drawn by a prescribed pen and is preset based on theresolution. In this way, the first searching range P1 sa is set to aregion whose range from the first reference pixel P1 s at its center isshorter than the width WL of the encircling line. This configurationreduces the likelihood of a color value pixel being selected from aregion other than the inside region 85 ci or outside region 85 co thatincludes the reference pixel. For example, if the first reference pixelP1 s is a pixel in the outside region 85 co, the first searching rangeP1 sa is configured to include pixels in the outside region 85 co, butnot pixels in the inside region 85 ci. This prevents a color value pixelfrom being selected from the inside region 85 ci when the firstreference pixel P1 s is a pixel in the outside region 85 co.

Next, the color value modification unit 430 selects onenon-encircling-line pixel from the first searching range P1 sa as atarget pixel. The following description will assume that the first colorvalue pixel P1 in FIG. 7A has been selected as the target pixel. Thecolor value modification unit 430 calculates the distribution of colorvalues using all non-encircling-line pixels in a first calculation rangeP1 sr centered on the first color value pixel P1. In the thirdembodiment, the first calculation range P1 sr is a prescribedrectangular region centered on the first color value pixel P1 that hastwo sides parallel to the first direction Dx and two sides parallel tothe second direction Dy. Each side of the first calculation range P1 sris set to the length “2*(3-resolution/300)+1”, for example, where thesymbol “*” is the multiplication operator and the result has units innumbers of pixels. In this example, “resolution” indicates theresolution of the scan data and is given in units of dpi. When theresolution is 300 dpi, each side of the first calculation range P1 sr isset to 7 pixels. When the resolution is 600 dpi, each side of the firstcalculation range P1 sr is set to a length of 13 pixels.

In the third embodiment, the color value includes R, G, and B componentvalues. Therefore, the color value modification unit 430 calculates thedistribution of R component values, the distribution of G componentvalues, and the distribution of B component values and uses the largestof these three distributions as the distribution of color values. As analternative, the color value modification unit 430 may employ thedistribution of a specific color component. For example, the color valuemodification unit 430 may calculate a brightness value from the R, G,and B component values and find the distribution of brightness values.

The color value modification unit 430 performs this type of distributioncalculation using each of the non-encircling-line pixels in the firstsearching range P1 sa as the target pixel. Next, the color valuemodification unit 430 selects the pixel based on which the smallestdistribution was found as the color value pixel. In the example of FIG.7A, the color value modification unit 430 has selected the first colorvalue pixel P1 as the color value pixel. The color value modificationunit 430 similarly selects color value pixels P2, P3, and P4 based onthe other reference pixels P2 s, P3 s, and P4 s. For example, the colorvalue modification unit 430 selects the second color value pixel P2 in asecond searching range P2 sa using the second reference pixel P2 s asreference. The second searching range P2 sa is configured to includepixels in the inside region 85 ci, which possesses the second referencepixel P2 s, and to not include pixels in the outside region 85 co.

FIG. 7C shows an equation for calculating the color value Pti of thefirst target pixel Pt based on color values P1 ia-P4 ia acquired fromthe four color value pixels P1-P4. The equation in FIG. 7C differs fromthat in FIG. 5B in two ways. The first difference is that distances D1s-D4 s do not indicate the distances between the first target pixel Ptand the corresponding color value pixels P1-P4, but rather indicate thedistances between the first target pixel Pt and the reference pixels P1s-P4 s. For example, the first distance D1 s indicates the distancebetween the first target pixel Pt and the first reference pixel P1 s,and the second distance D2 s indicates the distance between the firsttarget pixel Pt and the second reference pixel P2 s, for example.

The second difference is that the color values P1 ia-P4 ia are theaverage color values of non-encircling-line pixels within calculationranges centered on the color value pixels P1-P4, respectively. Forexample, the first color value P 1 is the average color value ofnon-encircling-line pixels in the first calculation range P1 sr centeredon the first color value pixel P1, and the second color value P2 ia isthe average color value of non-encircling-line pixels within a secondcalculation range P2 sr centered on the second color value pixel P2.

In this way, the color values P1 ia-P4 ia calculated based on the colorvalue pixels P1-P4, respectively, are average color values withinregions with small color distributions. Hence, the average color valuesP1 ia-P4 ia are expected to represent values approaching the originalcolor values in peripheral regions of the encircling line region (abackground region, for example); that is, color values not influenced bynoise. The equation in FIG. 7C is predicated on the assumption that theoriginal color values of the reference pixels P1 s-P4 s areapproximately the same as the color values P1 ia-P4 ia obtained based onthe color value pixels P1-P4.

While the above description pertains to the first target pixel Pt, thecolor value modification unit 430 similarly changes the color values ofthe other pixels in the encircling line region 85 c.

Thus, as in the first embodiment described above, the color value of thefirst target pixel Pt in the third embodiment is set using color valuesof a plurality of non-encircling-line pixels surrounding the firsttarget pixel Pt. Therefore, the third embodiment has the same advantagesas the first embodiment.

As shown in FIG. 7C, the weight applied to the second average colorvalue P2 ia for the plurality of pixels including the second color valuepixel P2 (i.e. the color value associated with the second color valuepixel P2) is larger for a smaller second distance D2 s between the firsttarget pixel Pt and the second reference pixel P2 s, which is associatedwith the second color value pixel P2. The same is true for the fourthcolor value pixel P4. Further, the weight applied to the first averagecolor value P1 ia for the plurality of pixels including the first colorvalue pixel P1 (i.e. the color value associated with the first colorvalue pixel P1) is larger for a smaller first distance D1 s between thefirst target pixel Pt and the first reference pixel P1 s, which isassociated with the first color value pixel P1. The same holds true forthe third color value pixel P3. In this way, the color valuemodification unit 430 can change the color value of the first targetpixel Pt to a value suited to the positional relationships among thefirst target pixel Pt, the internal reference pixels P2 s and P4 s, andthe external reference pixels P1 s and P3 s, thereby suppressing anynoticeable traces of the encircling line object 85 in the processedimage.

As described with reference to FIG. 7A, the color value modificationunit 430 selects the first color value pixel P1 from a prescribed rangecentered on the first reference pixel P1 s (specifically, from the firstsearching range P1 sa). In other words, the first reference pixel P1 sis a pixel within a prescribed range centered on the first color valuepixel P1 (a range having the same shape as the searching range).Similarly, the color value modification unit 430 selects the secondcolor value pixel P2 from a prescribed range centered on the secondreference pixel P2 s (specifically, from the second searching range P2sa). In other words, the second reference pixel P2 s is a pixel within aprescribed range centered on the second color value pixel P2. Bymodifying the color value of the first target pixel Pt according to thefirst reference pixel P1 s near the first color value pixel P1 and thesecond reference pixel P2 s near the second color value pixel P2, thecolor value modification unit 430 can minimize any noticeable traces ofthe encircling line object 85 in the processed image.

FIG. 7A also shows two line segments Sg1 o and Sg2 o passing through thefirst target pixel Pt. The first line segment Sg1 o is orthogonal to aline segment Sg1 passing through the first target pixel Pt and firstcolor value pixel P1, and the second line segment Sg2 o is orthogonal toa line segment Sgt passing through the first target pixel Pt and secondcolor value pixel P2.

The color value modification unit 430 selects the first reference pixelP1 s from the region that includes the first color value pixel P1obtained by dividing the scanned image by the first line segment Sg1 ointo two regions (specifically, the region on the −Dy side of the firstline segment Sg1 o). As described with reference to FIG. 7A, the firstreference pixel P1 s is positioned on the edge of the outside region 85co abutting the encircling line region 85 c. In other words, the firstreference pixel P1 s is positioned so that its distance from the edge ofthe outside region 85 co is no greater than the width WL of theencircling line region 85 c as shown in FIG. 7B. Thus, a pixel near thefirst color value pixel P1 can be used as the first reference pixel P1s.

Similarly, the color value modification unit 430 selects the secondreference pixel P2 s from the region that includes the second colorvalue pixel P2 obtained by dividing the scanned image by the second linesegment Sg2 o into two regions (specifically, the region on the +Dy sideof the second line segment Sg2 o). As described with reference to FIG.7A, the second reference pixel P2 s is positioned on the edge of theinside region 85 ci abutting the encircling line region 85 c. In otherwords, the second reference pixel P2 s is positioned so that itsdistance from the edge of the inside region 85 ci is no greater than thewidth WL of the encircling line region 85 c as shown in FIG. 7B. Thus, apixel near the second color value pixel P2 can be used as the secondreference pixel P2 s.

Through the above configuration, the color value modification unit 430can minimize noticeable traces of the encircling line object 85 in theprocessed image.

As described with reference to FIG. 7A, the color value modificationunit 430 sets each of the plurality of non-encircling-line pixels withinthe first searching range P1 sa determined based on the first referencepixel P1 s (that is, the first target pixel Pt) as a target pixel,determines the distribution of color values within a calculation rangebased on the position of this target pixel, and uses the pixel whosecalculation range has the smallest distribution of color values as thefirst color value pixel P 1. Similarly, the color value modificationunit 430 sets each of the plurality of non-encircling-line pixels withinthe second searching range P2 sa determined based on the secondreference pixel P2 s (that is, the first target pixel Pt) as a targetpixel, determines the distribution of color values within a calculationrange based on the position of this target pixel, and uses the pixelwhose calculation range has the smallest distribution of color values asthe second color value pixel P2. Therefore, the color value modificationunit 430 can mitigate the effects of noise on the color value of thefirst target pixel Pt in order to minimize noticeable traces of theencircling line object 85 in the processed image.

As described with reference to FIG. 7A, the color value modificationunit 430 also sets search ranges, such as the first searching ranges P1sa and P2 sa, based on the resolution of the scanned image (that is, thepixel density). Therefore, the color value modification unit 430 canchange the color value of the first target pixel Pt to a value suited tothe pixel density in order to minimize noticeable traces of theencircling line object 85 in the processed image.

As shown in FIG. 7A, the third reference pixel P3 s and fourth referencepixel P4 s are disposed at opposite ends of a line segment intersectingthe line segment connecting the first reference pixel P1 s and secondreference pixel P2 s. As a result, the third color value pixel P3 andfourth color value pixel P4 used for calculating the color value of thefirst target pixel Pt are disposed on respective ends of a line segment(not shown) that intersects the line segment (not shown) connecting thefirst color value pixel P1 and second color value pixel P2. Accordingly,the color value modification unit 430 can change the color value of thefirst target pixel Pt to a value suited to color changes in a pluralityof directions. The same effect can be obtained for the other targetpixels. As a result, the color value modification unit 430 can minimizenoticeable traces of the encircling line object 85 in the processedimage.

D. Fourth Embodiment

A fourth embodiment of the present invention will be described withreference to FIGS. 8A, 8B and 8C. FIG. 8A is a schematic diagramillustrating a fourth embodiment for changing color values of targetpixels in encircling line regions (S320 of FIG. 4). The fourthembodiment differs from the second embodiment shown in FIGS. 6A and 6Bin the following ways. First, the color value modification unit 430sorts eight color value pixels P1-P8 for calculating the color value ofthe first target pixel Pt into pixels pairs, each of which is composedof two pixels disposed along a line passing through the first targetpixel Pt. As a result, the eight color value pixels P1-P8 are sortedinto four pixel pairs. Next, the color value modification unit 430calculates the color value of the first target pixel Pt using some ofthe four pixels pairs whose members have the largest difference in colorvalue. The hardware structure of the image-processing system used in theimage process according to the fourth embodiment is identical to theimage-processing system 900 shown in FIG. 1. Further, steps in the imageprocess according to the fourth embodiment are identical to the stepsshown in FIGS. 2 and 4.

The partial image shown in FIG. 8A is identical to the image in FIG. 6A.FIG. 8A specifies eight color value pixels P1-P8. FIG. 8B is anexplanatory diagram for describing four pixel pairs Pr1-Pr4, color valuedifferences dC1-dC4, and selected pixel pairs. As shown, the four pixelpairs Pr1, Pr2, Pr3, and Pr4 are respectively configured of the pairs ofpixels P1 and P2, P3 and P4, P5 and P6, and P7 and P8. The color valuemodification unit 430 calculates the color value differences dC1-dC4between the members of each pixel pair Pr1-Pr4, respectively. Here, thecolor value modification unit 430 employs the difference in a specificcolor component. For example, the color value modification unit 430 maycalculate a brightness value based on the R, G, and B component valuesand may employ the difference in brightness values between members ofeach pixel pair.

Next, the color value modification unit 430 selects pixel pairs having arelatively large difference in the color values of their members.Specifically, the color value modification unit 430 selects the pixelpair whose members have the largest difference in color value and thepixel pair whose members have the second largest difference in colorvalue. In the following description, the pixels in the pixel pair whosecolor difference is the largest will be called pixels Pm1 and Pm2, andthe pixels in the pixel pair having the second largest difference incolor value will be called pixels Pn1 and Pn2.

FIG. 8C shows an equation for calculating the color value Pti of thefirst target pixel Pt from color values Pm1 i, Pm2 i, Pn1 i, and Pn2 ifor the two selected pixel pairs (i.e., the four color value pixels Pm1,Pm2, Pn1, and Pn2). Here, the symbol “i” identifies one of the colorsred, green, and blue, and distances Dm1, Dm2, Dn1, and Dn2 denote thedistances from the first target pixel Pt to the color value pixels Pm1,Pm2, Pn1, and Pn2, respectively.

As shown in the equation, the color value Pti of the first target pixelPt is the weighted average value of the color values Pm1 i, Pm2 i, Pn1i, and Pn2 i for the four color value pixels P1-P4. Weights assigned tothe color values Pm1 i, Pm2 i, Pn1 i, and Pn2 i are larger for smallerdistances Dm1, Dm2, Dn1, and Dn2. Hence, the color value modificationunit 430 can change the color value of the first target pixel Pt to avalue suited to the positional relationships among the first targetpixel Pt and the color values Pm1 i, Pm2 i, Pn1 i, and Pn2 i. Thus, thecolor value modification unit 430 can modify the color value of thefirst target pixel Pt to a value suited to color changes within theperipheral region of the first target pixel Pt (the background region,for example).

In the fourth embodiment, the color value modification unit 430calculates a post-modification color value of the first target pixel Ptusing the pixels in two of the four pixel pairs whose members have arelatively large difference in color value. Thus, the color valuemodification unit 430 can calculate the color value of the first targetpixel Pt using pixel pairs whose members have a large difference incolor value when this difference is due to gradation in the peripheralregion of the encircling line region 85 c (a background region, forexample) and, hence, can minimize noticeable traces of the encirclingline object 85 in the processed image.

In the example of FIG. 8A, three of the four pixel pairs Pr1-Pr4(specifically, the pixel pairs Pr1, Pr2, and Pr3) include a pixel in theoutside region 85 co and a pixel in the inside region 85 ci. Only someof these three pixel pairs Pr1, Pr2, and Pr3 having a relatively largedifference in color value among its members are used for calculating thecolor value of the first target pixel Pt. Hence, if the color changes ina specific direction, the color value modification unit 430 can modifythe color values of pixels in the encircling line region 85 c to valuessuited to this change in color.

As shown in FIG. 8A, members in each of the four pixel pairs arepositioned isotropically in relation to the first target pixel Pt.Hence, three or more pixel pairs may include both a pixel in the outsideregion 85 co and a pixel in the inside region 85 ci in areas of thecurved encircling line region 85 c where the curvature is small, asillustrated in FIG. 8A. In the fourth embodiment, the color valuemodification unit 430 uses some of the pixel pairs that include both apixel in the outside region 85 co and a pixel in the inside region 85 cithat are associated with a relatively large difference in color value.Accordingly, when the color changes from the outside region 85 co to theinside region 85 ci, the color value modification unit 430 can modifythe color values of pixels in the encircling line region 85 c to valuessuitable for this change in color.

E. Fifth Embodiment

A fifth embodiment of the present invention will be described withreference to FIG. 9. FIG. 9 is a schematic diagram showing a fifthembodiment for changing color values of target pixels in an encirclingline region (S320 of FIG. 4). The fifth embodiment in FIG. 9 differsfrom the third embodiment shown in FIGS. 7A and 7B in that the pixelsselected as the reference pixels P1 s-P4 s are separated from theencircling line region 85 c. Specifically, the first reference pixel P1s is the closest pixel to the first target pixel Pt among the pluralityof non-encircling-line pixels on a line extending in the −Dy directionfrom the first target pixel Pt that remain after excluding pixelsabutting the encircling line region 85 c. Pixels separated from theencircling line region 85 c are similarly selected as the otherreference pixels P2 s-P4 s. The steps for selecting the color valuepixels P1-P4 and for calculating the color value of the first targetpixel Pt are identical to those described with reference to FIG. 7.

In this way, pixels separated from the encircling line region 85 c canbe employed as the reference pixels P1 s-P4 s used for positionalreference. Since pixels far from the encircling line region 85 c are farfrom the edge of the encircling line object 85, these pixels have littleeffect from noise in color values (and specifically, noise produced nearthe edge). Hence, by selecting the color value pixels P1-P4 based onreference pixels P1 s-P4 s separated from the encircling line region 85c, the color value modification unit 430 can suppress the effects ofnoise on color values. However, if the distance between the referencepixels P1 s-P4 s and the encircling line region 85 c is excessive, theencircling line region 85 c may be corrected to a color that isdifferent from the peripheral color of the encircling line region 85 c.Therefore, the reference pixels P1 s-P4 s are preferably close to theencircling line region 85 c in order to minimize noticeable traces ofthe encircling line object 85 in the processed image. For example, thesecond color value pixel P2 and fourth color value pixel P4 in theinside region 85 ci are preferably set to pixels that are within a rangeno greater than the width WL of the encircling line region 85 c from theedge of the inside region 85 ci that abuts the encircling line region 85c. Similarly, the first color value pixel P1 and third color value pixelP3 in the outside region 85 co are preferably set to pixels within arange no greater than the width WL of the encircling line of theencircling line region 85 c from the edge of the outside region 85 cothat abuts the encircling line region 85 c.

Sometimes blur is produced near the edge (contour, for example) of anobject such as an encircling line in a scanned image generated by thereading unit 160. In the third embodiment shown in FIGS. 7A, 7B, and 7Cand the fifth embodiment shown in FIG. 9, the color value modificationunit 430 calculates the color values of pixels in an encircling lineregion using the color values of pixels separated from the encirclingline region. Accordingly, the color value modification unit 430 canmitigate the effects of blurring on the calculated color values and cansuitably minimize noticeable traces of the encircling line in theprocessed image.

F. Variations of the Embodiments

(1) The color correction process performed by the color valuemodification unit 430 on encircling line regions is not limited to theprocesses described in the embodiments, but may be any of variousprocesses that set the color of the encircling line region close to thecolor of the region around the encircling line region. For example, whencalculating at least one of the (a) distribution of color values and (b)average color value in the third and fifth embodiments of FIGS. 7A-7Cand 9, the color value modification unit 430 may skip some of the pixelsin the calculation range, such as the pixels in even rows. Further,instead of using the average color value in the calculation region, thecolor value modification unit 430 may simply use the color value of thepixel whose calculation range was found to have the smallestdistribution. For example, the color value modification unit 430 may usethe color value of the first color value pixel P1, rather than anaverage value, as the first color value P1 ia in FIG. 7C. In general,the color value modification unit 430 may use the color value of atleast one pixel in the calculation range for calculating the color valueof the first target pixel Pt. Further, the color value modification unit430 is not limited to using pixels whose calculation ranges have thesmallest distributions as the color value pixels P1-P4, but may use anyof various pixels in the searching ranges excluding whose calculationranges have the greatest distributions. Further, the searching rangesare not limited to rectangular regions, but may be regions having any ofvarious shapes. For example, a circular region centered on the referencepixel may be used as the searching range. In any case, the searchingrange preferably is a region that includes the reference pixel.Similarly, the calculation range is not limited to a rectangular region,but may be a region of any shape, such as a circular region centered onthe target pixel. In any case, the calculation region preferablyincludes the target pixel.

(2) The total number of color value pixels used for calculating thecolor value of one first target pixel Pt in the first to fifthembodiments shown in FIGS. 5A through 9 may be any number of 2 orgreater. For example, the color value of the first target pixel Pt inthe example of FIG. 5A may be calculated from the two color value pixelsP1 and P2. Further, the method of selecting the color value pixels isnot limited to the methods described with reference to FIGS. 5A through9, but may be any of various methods such as a method that uses allnon-encircling-line pixels within a prescribed region centered on thefirst target pixel Pt.

Further, the method of calculating the color value of the first targetpixel Pt using color values of a plurality of color value pixels is notlimited to the method described in the examples of FIG. 5A through 9,but may be any of various methods such as a method that simply employsaverages without weighting.

(3) In the first, second, third, and fifth embodiments described withreference to FIGS. 5A through 7C and 9, the color value of the firsttarget pixel Pt may be calculated as described in the embodiment withreference to FIGS. 8A-8C using some of the plurality of pixel pairswhose members have the greatest difference in color value. The totalnumber of pixel pairs used for calculating the color value of the firsttarget pixel Pt may be any number of 1 or greater. Alternatively, apreset number of pixel pairs may be used.

(4) Rather than using the encircling line region 85 c identified in S240as the encircling line region to be used by the color value modificationunit 430, the region identification unit 420 may employ the thirdcandidate region 85 b identified in S220.

(5) The image process of the present invention may be modified invarious ways and is not limited to the steps shown in FIG. 2. Forexample, any of various methods may be used to identify regionsconstituting encircling lines (i.e., encircling line regions) andregions not constituting encircling lines based on the target image, andare not limited to the method described in S205-S240 of FIG. 2. Forexample, step S210 may be omitted from the process. Further, patternmatching using prescribed patterns representing typical encircling lineregions may be performed to identify encircling line regions in a targetimage. Further, the process in step S255 is not limited to a process forerasing objects enclosed in the encircling lines, but may be any processusing objects enclosed in the encircling lines. For example, a processmay be performed to erase all other objects in the image, whileretaining the objects enclosed in the encircling lines. In any case, thecolor of pixels representing the objects may be interpolated whenerasing the objects, as described in the process of step S250.

(6) The data processed according to the present invention may beemployed in any application in addition to printing. For example, theprocessed data acquisition unit 230 of the multifunction peripheral 100may store the processed data in the nonvolatile storage device 130 forfuture use. Further, the destination of the processed data outputted bythe processed data output unit 450 may be any device in addition to themultifunction peripheral 100. For example, the processed data outputunit 450 may output the processed data to another server (not shown)connected to the network 500.

(7) In addition to scan data produced by the reading unit 160, thetarget image data may be photographic image data captured by a devicesuch as a digital camera, or image data generated using an applicationprogram for creating data such as text or illustrations, for example.Further, the encircling lines are not limited to those written with apen, but may be encircling lines drawn over the image using theapplication program described above, for example.

(8) The functions in the embodiment of FIG. 1 for executing the imageprocess (for example, the function of the image-processing unit 390, andspecifically the functions of the process units 410, 420, 430, 440, and450) may be implemented by various other devices than the server 300,such as a digital camera, a scanner, a personal computer, and a mobiletelephone. Further, the functions of the image-processing unit 390 maybe shared among a plurality of devices (computers, for example) capableof communicating over a network, so that the devices as a whole canprovide the functions of the image-processing unit 390 (here, the systemcomprising the devices corresponds to the image processor).

Part of the configuration implemented in hardware in the embodimentsdescribed above may be replaced with software and, conversely, all orpart of the configuration implemented in software in the embodiments maybe replaced with hardware. For example, the functions of the regionidentification unit 420 in FIG. 1 may be implemented by dedicatedhardware configured of logic circuits.

When all or part of the functions of the present invention areimplemented with computer programs, the programs can be stored on acomputer-readable storage medium (a non-temporary storage medium, forexample). The programs may be used on the same storage medium on whichthey were supplied, or may be transferred to a different storage medium(computer-readable storage medium). The “computer-readable storagemedium” may be a portable storage medium, such as a memory card orCD-ROM; an internal storage device built into the computer, such as anyof various ROM; or an external storage device, such as a hard disk driveconnected to the computer.

While the invention has been described in detail with reference tospecific embodiments and variations thereof, it would be apparent tothose skilled in the art that many modifications and variations may bemade therein without departing from the spirit of the invention, thescope of which is defined by the attached claims.

What is claimed is:
 1. An image-processing device comprising: aprocessor; and a memory storing computer-readable instructions therein,the computer-readable instructions, when executed by the processor,causing the image-processing device to perform: identifying a firstregion and a second region in a target image represented by target imagedata, the first region representing an encircling line for identifying aspecific sub-region in the target image, the first region including aplurality of pixels, the second region being different from the firstregion, the second region including: an inside region that is surroundedby the first region; and an outside region that is outside the firstregion, the inside region having a plurality of internal pixels, theoutside region having a plurality of external pixels; and changing acolor value of each of the plurality of pixels using a color value ofone of the plurality of internal pixels and a color value of one of theplurality of external pixels; wherein the changing changes a color valueof a first target pixel included in the plurality of pixels using acolor value of a first internal pixel included in the plurality ofinternal pixels and a color value of a first external pixel included inthe plurality of external pixels; and wherein the changing changes acolor value of a second target pixel included in the plurality of pixelsusing a color value of a second internal pixel included in the pluralityof internal pixels and a color value of a second external pixel includedin the plurality of external pixels.
 2. The image-processing deviceaccording to claim 1, wherein the color value of the first target pixelis changed to a color value between the color value of the firstinternal pixel and the color value of the first external pixel; andwherein the color value of the second target pixel is changed to a colorvalue between the color value of the second internal pixel and the colorvalue of the second external pixel.
 3. The image-processing deviceaccording to claim 1, wherein the instructions further cause theimage-processing device to perform: selecting a first internal referencepixel corresponding to the first internal pixel and a first externalreference pixel corresponding to the first external pixel; assigning afirst weight to the color value of the first internal pixel, the firstweight being larger in the case that a first distance between the firsttarget pixel and the first internal reference pixel is smaller; andassigning a second weight to the color value of the first externalpixel, the second weight being larger in the case that a second distancebetween the first target pixel and the first external reference pixel issmaller; and wherein the color value of the first target pixel ischanged using the first weight and the second weight.
 4. Theimage-processing device according to claim 3, wherein the first internalreference pixel falls within a prescribed range centered on the firstinternal pixel; and wherein the first external reference pixel fallswithin a prescribed range centered on the first external pixel.
 5. Theimage-processing device according to claim 3, wherein the first externalreference pixel has a third distance from an edge of the outside regionthat the first region contacts with, the third distance being no greaterthan a width of the encircling line represented by the first region, thefirst external reference pixel being positioned in one of two firstdivisional regions that includes the first external pixel, the two firstdivisional regions being obtained by dividing the target image by afirst line, the first line passing through the first target pixel andbeing orthogonal to a line that connects the first target pixel and thefirst external pixel; and wherein the first internal reference pixel hasa fourth distance from an edge of the inside region that the firstregion contacts with, the fourth distance being no greater than thewidth of the first region, the first internal reference pixel beingpositioned in one of two second divisional regions that includes thefirst internal pixel, the two second divisional regions being obtainedby dividing the target image by a second line, the second line passingthrough the first target pixel and being orthogonal to a line thatconnects the first target pixel and the first internal pixel.
 6. Theimage-processing device according to claim 1, wherein the inside regionhas a third internal pixel and the outside region has a third externalpixel; wherein the color value of the first target pixel is changedusing color values of the first internal pixel, the first externalpixel, the third internal pixel, and the third external pixel; andwherein one line segment connects the third internal pixel and the thirdexternal pixel, and another line segment connects the first internalpixel and the first external pixel, the one line segment intersectingthe another line segment.
 7. The image-processing device according toclaim 1, wherein the inside region has a third internal pixel and theoutside region has a third external pixel; wherein the instructionsfurther cause the image-processing device to perform calculating a firstdifference and a second difference, the first difference being adifference between the color value of the first internal pixel and thecolor value of the first external pixel, the second difference being adifference between a color value of the third internal pixel and a colorvalue of the third external pixel; wherein the color value of the firsttarget pixel is changed based on the color value of the first internalpixel and the color value of the first external pixel in the case thatthe first difference is larger than the second difference; and whereinthe color value of the first target pixel is changed based on the colorvalue of the third internal pixel and the color value of the thirdexternal pixel in the case that the second difference is larger than thefirst difference.
 8. The image-processing device according to claim 1,wherein the instructions further cause the image-processing device toperform: specifying an internal searching range based on the firsttarget pixel; setting a first prescribed range for each of pixels thatare within the internal searching range, determining, as the firstinternal pixel, a specific internal pixel falling within the internalsearching range and different from a pixel whose first prescribed rangehas a largest distribution of color values; specifying an externalsearching range based on the first target pixel; setting a secondprescribed range for each of pixels that are within the externalsearching range; and determining, as the first external pixel, aspecific external pixel falling within the external searching range anddifferent from a pixel whose second prescribed range has a largestdistribution of color values.
 9. The image-processing device accordingto claim 8, wherein the internal searching range and the externalsearching range are set based on a pixel density of the target image.10. The image-processing device according to claim 1, wherein theinstructions further cause the image-processing device to perform:selecting the first target pixel and the second target pixel; settingthe first external pixel and the first internal pixel based on the firsttarget pixel in the case that the first target pixel is selected; andsetting the second external pixel and the second internal pixel based onthe second target pixel in the case that the second target pixel isselected.
 11. A non-transitory computer readable storage medium storinga set of program instructions executed by a computer, the programinstructions comprising: identifying a first region and a second regionin a target image represented by target image data, the first regionrepresenting an encircling line for identifying a specific sub-region inthe target image, the first region including a plurality of pixels, thesecond region being different from the first region, the second regionincluding: an inside region that is surrounded by the first region; andan outside region that is outside the first region, the inside regionhaving a plurality of internal pixels, the outside region having aplurality of external pixels; and changing a color value of each of theplurality of pixels using a color value of one of the plurality ofinternal pixels and a color value of one of the plurality of externalpixels; wherein the changing changes a color value of a first targetpixel included in the plurality of pixels using a color value of a firstinternal pixel included in the plurality of internal pixels and a colorvalue of a first external pixel included in the plurality of externalpixels; and wherein the changing changes a color value of a secondtarget pixel included in the plurality of the pixels using a color valueof a second internal pixel included in the plurality of internal pixelsand a color value of a second external pixel included in the pluralityof external pixels.